#include <stdio.h>

int Fact(int m){
	int a,end=1;
	for (a=1;a<=m;a++){
		end *= a;
	}
	return end;
}


int main(void){
	int n,m,count=0;
	scanf("%d", &n);
	for (m=1;count<n;m++){
		count += Fact(m);
	}
	printf("%d", m-2);
	return 0;
}
